﻿<?php
/**
* @package           mod_jstats_counters - Counters for 'Joomla Stats'
*  project homepage  http://www.JoomlaStats.org
* @copyright         Copyright (C) 2005-2008 JoomlaStats Team
* @license           GNU/GPL, see http://www.gnu.org/copyleft/gpl.html.
*/


defined('_JEXEC') or die ('Direct Access to this location is not allowed.');



//for performance we include JS general API instead of whole JoomlaStats API
//$js_PathToJoomlaStatsApi = JPATH_ADMINISTRATOR .DS. 'components' .DS. 'com_joomlastats' .DS. 'api' .DS. 'api.include.php';
$js_PathToJoomlaStatsGeneralApi = JPATH_ADMINISTRATOR .DS. 'components' .DS. 'com_joomlastats' .DS. 'api' .DS. 'general.php';
if ( !is_readable($js_PathToJoomlaStatsGeneralApi) || !include_once($js_PathToJoomlaStatsGeneralApi) ) {
	$this_js_extension_homepage = 'http://www.joomlastats.org/index.php?option=com_content&amp;task=view&amp;id=33&amp;Itemid=38';//remeber to replace '&' by '&amp;'
	$this_js_extension_install_problem_text = '<div style="color: red;">It seams that <a href="'.$this_js_extension_homepage.'" target="_blank"><b>module Counters (mod_jstats_counters)</b></a> is not installed correctly. Please refer to <a href="http://www.joomlastats.org/entry/installation_noengine.php" target="_blank"><b>JoomlaStats extension installation problem</b></a> page.</div><br/><br/>';
	echo $this_js_extension_install_problem_text;
	return false; //this will end of this script //this also solve problem require_once (include_once now is enough and it generate only warning)
}


require_once(dirname(__FILE__) .DS. 'helper.php');



//$params->def('visualization_type', 1);// 0 -1 column table
$counter_arr = modJStatsCounters::getCounterArr( $params );


require(JModuleHelper::getLayoutPath('mod_jstats_counters'));


